package com.dhj.streamTest;

import com.dhj.streamTest.entity.Author;

import java.util.List;
import java.util.function.Consumer;
import java.util.function.Function;

import static com.dhj.streamTest.entity.AuthorList.getAuthors;

public class Demo5 {

    public static void main(String[] args) {
        List<Author> authors = getAuthors();

        authors.stream().distinct().forEach(new Consumer<Author>() {
            @Override
            public void accept(Author author) {
                System.out.println(author.getName()+"=="+author.getAge());
            }
        });


        System.out.println("===============");

        authors.stream().distinct().forEach(author -> System.out.println(author.getName()+"--"+author.getAge()));

    }
}
